package com.ks.redis;

import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;

public class TestReadProperties {

	public static void main(String[] args) throws IOException {
		InputStream in = TestReadProperties.class.getClassLoader().getResourceAsStream("redis.properties");
		Properties properties = new Properties();
		properties.load(in);
//		System.out.println(properties.getProperty("redis.pool.maxActive"));

		// 转换Map
		Map<String, Object> map = new HashMap<String, Object>();
		for (Map.Entry<Object, Object> keySet : properties.entrySet()) {
			map.put((String) keySet.getKey(), keySet.getValue());
		}
		
		for (Map.Entry<String, Object> entry: map.entrySet()) {
			System.out.println(entry);
		}
	}

}
